import request from '@/utils/request'

export function showPaperList(query) {
  return request({
    url: '/exam/paper/show',
    method: 'get',
    params: query
  })
}

export function getPaperInfo(paperId) {
  return request({
    url: '/exam/paper/get/' + paperId,
    method: 'get'
  })
}

export function deletePaper(paperId) {
  return request({
    url: '/exam/paper/delete/' + paperId,
    method: 'get'
  })
}

export function releasePaper(paperId) {
  return request({
    url: '/exam/paper/release/' + paperId,
    method: 'get'
  })
}

export function sumPaperScore(paperId) {
  return request({
    url: '/exam/paper/score/total/' + paperId,
    method: 'get'
  })
}

export function showQuestionList(query) {
  return request({
    url: '/exam/question/show',
    method: 'get',
    params: query
  })
}

export function editPaperInfo(data) {
  return request({
    url: '/exam/paper/edit',
    method: 'post',
    data
  })
}

export function addPaperInfo(data) {
  return request({
    url: '/exam/paper/add',
    method: 'post',
    data
  })
}

export function orderQuestions(data) {
  return request({
    url: '/exam/question/ordered',
    method: 'post',
    data
  })
}

export function getQuestionInfo(questionId) {
  return request({
    url: '/exam/question/get/' + questionId,
    method: 'get'
  })
}

export function addPaperQuestion(data) {
  return request({
    url: '/exam/question/add',
    method: 'post',
    data
  })
}

export function deleteQuestion(questionId) {
  return request({
    url: '/exam/question/delete/' + questionId,
    method: 'get'
  })
}

export function getPaperRankBaseInfo(paperId) {
  return request({
    url: '/exam/rank/paper/' + paperId,
    method: 'get'
  })
}

export function getPaperRankUsers(paperId, query) {
  return request({
    url: '/exam/rank/user/' + paperId,
    method: 'get',
    params: query
  })
}

export function exportRankUserList(paperId) {
  return request({
    url: '/exam/rank/user/export/' + paperId,
    method: 'get'
  })
}

export function getQuestionAnswerStatistics(questionId) {
  return request({
    url: '/exam/question/statistic/' + questionId,
    method: 'get'
  })
}

export function showUserAnswerList(query) {
  return request({
    url: '/exam/userAnswer/show',
    method: 'get',
    params: query
  })
}

export function exportQuestionExplain(questionId) {
  return request({
    url: '/exam/question/export/' + questionId,
    method: 'get'
  })
}
